<template>
	<view class="user clearfix  bg-shop hv100">
		<cu-custom bgColor="bg-white " isBack>
			<block slot="content">意见反馈</block>
		</cu-custom>
		<view class="px20 f12 text-info bg-white mt5">
			<textarea v-model="desc" maxlength="300" @input="writeings" placeholder="请留下您的吐槽或建议,我们一直在改~"
				placeholder-class="text-info f12" class="pt10 text-black wp100 writebox-textarea"></textarea>
		</view>
		<view class="bg-white flex align-center justify-end px15 pb10">
			<text class="text-red">{{worldss}}</text>
			<text class="text-info">/</text>
			<text class="text-info">300</text>
		</view>
		<view class="set-button discenter f16" @click="gongdansure">确认提交</view>
	</view>
</template>

<script>
import { mapState, mapActions } from 'vuex'
export default {
	data() {
		return {
			desc:'',
			worldss:0
		}
	},
	computed: {
		...mapState(['userInfo','baseURL'])
	},
	methods: {
		...mapActions(['logout','getUser']),
		writeings() {
			this.worldss = this.desc.length
		},
		async gongdansure(){
			if(this.desc==''){
				uni.showToast({
					title:'请填写内容',
					icon:'none'
				})
				return false
			}
			let { data } = await this.$http.post('user.gongdan',{desc:this.desc}, {
				tipConfig: { storeLoading: true, isSuccessTip: true, isSuccessBack: true, navigateBack: 1  }
			})
		}
	}
}
</script>

<style lang="less">
.mt1s{
	margin-top: 1rpx;
}
.set-button{
	width: calc(100% - 60rpx);
	margin-left: 30rpx;
	height: 90rpx;
	background-color:#FE4725;
	color: #FFFFFF;
	border-radius: 10rpx;
	margin-top: 80rpx;
}
</style>
